﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <style type="text/css">
        #first
        {
            width:120px;
            height:1800px;
            border:1px solid gray;
            line-height:600px;
            background-color:#B7F1FF;
        }
        #second
        {
            position:fixed;    /*设置元素为固定定位*/
            top:30px;          /*距离浏览器顶部30px*/
            left:160px;        /*距离浏览器左部160px*/
            width:60px;
            height:60px;
            border:1px solid silver;
            background-color:hotpink;
        }
    </style>
</head>
<body>
    <div id="first">无定位的div元素</div>
    <div id="second">固定定位的div元素</div>
</body>
</html>
